﻿@using ArsenalManagement.Tools
@model PaginatedList<ArsenalManagement.Models.Weapon>

@{
    ViewData["Title"] = "Index";
}

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <title>DASHMIN - Bootstrap Admin Template</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta content="" name="keywords">
    <meta content="" name="description">



    <link rel="preconnect" href="https://fonts.googleapis.com/">
    <link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin="">
    <link href="~/css/css2.css" rel="stylesheet">

    <link href="~/css/all.min.css" rel="stylesheet">
    <link href="~/css/bootstrap-icons.css" rel="stylesheet">

    <link href="~/css/owl.carousel.min.css" rel="stylesheet">
    <link href="~/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet">

    <link href="~/css/bootstrap.min.css" rel="stylesheet">

    <link href="~/css/style.css" rel="stylesheet">
</head>

<body>
    <div class="container-fluid position-relative bg-white d-flex p-0">

        <div id="spinner"
            class="show bg-white position-fixed translate-middle w-100 vh-100 top-50 start-50 d-flex align-items-center justify-content-center">
            <div class="spinner-border text-primary" style="width: 3rem; height: 3rem;" role="status">
                <span class="sr-only">Loading...</span>
            </div>
        </div>


        <div class="sidebar pe-4 pb-3">
            <nav class="navbar bg-light navbar-light">
                <a href="index1.html" class="navbar-brand mx-4 mb-3">
                    <h3 class="text-primary"><i class="fa fa-hashtag me-2"></i>管理面板</h3>
                </a>
                <div class="d-flex align-items-center ms-4 mb-4">
                    <div class="position-relative">
                        <img class="rounded-circle" src="static/picture/user.jpg" alt=""
                            style="width: 40px; height: 40px;">
                        <div
                            class="bg-success rounded-circle border border-2 border-white position-absolute end-0 bottom-0 p-1">
                        </div>
                    </div>
                    <div class="ms-3">
                        <h6 class="mb-0">@ViewData["username"]</h6>
                        <span>管理员</span>
                    </div>
                </div>
                <div class="navbar-nav w-100">
                    <a asp-controller="Home" asp-action="Index" class="nav-item nav-link"><i class="fa fa-th me-2"></i>主页</a>
                    <a asp-controller="Weapon" asp-action="Index" class="nav-item nav-link active"><i class="fa fa-keyboard me-2"></i>武器管理</a>
                    <a asp-controller="Vehicle" asp-action="Index" class="nav-item nav-link"><i class="fa fa-table me-2"></i>载具管理</a>
                    <a asp-controller="Vessel" asp-action="Index" class="nav-item nav-link"><i class="fa fa-chart-bar me-2"></i>舰船管理</a>          
                </div>
            </nav>
        </div>
        <div class="content">
            <nav class="navbar navbar-expand bg-light navbar-light sticky-top px-4 py-0">
                
                <form asp-action="Index" class="d-none d-md-flex ms-4" method="get" >
                    <p>
                        <input type="text" name="SearchString" value="@ViewData["currentFilter"]" placeholder="搜索"/>
                        <input type="submit" value="搜索" />
                        <a asp-action="Index">返回完整列表</a>
                    </p>
                </form>
                
            </nav>
            <p>
                <a asp-action="Create">添加</a>
            </p>
            <table class="table table-striped">
                <thead>
                    <tr>
                        <th>
                            <a asp-action="Index" asp-route-sortOrder="@ViewData["NameSortParm"]" asp-route-currentFilter="@ViewData["CurrentFilter"]">武器名</a>
                        </th>
                        <th>
                            图片URL
                        </th>
                        <th>
                            <a asp-action="Index" asp-route-sortOrder="@ViewData["InfoSortParm"]" asp-route-currentFilter="@ViewData["CurrentFilter"]">武器简介</a>
                        </th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
            @foreach (var item in Model) {
                    <tr>
                        <td>
                            @Html.DisplayFor(modelItem => item.Weaponname)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.ImgUrl)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Info)
                        </td>
                        <td>
                            <a asp-action="Edit" asp-route-id="@item.Id">编辑</a> |
                            <a asp-action="Details" asp-route-id="@item.Id">详情</a> |
                            <a asp-action="Delete" asp-route-id="@item.Id">删除</a>
                        </td>
                    </tr>
            }
                </tbody>
            </table>
            @{
                var prevDisabled = !Model.HasPreviousPage ? "disabled" : "";
                var nextDisabled = !Model.HasNextPage ? "disabled" : "";
            }

            <a asp-action="Index"
                asp-route-sortOrder="@ViewData["CurrentSort"]"
                asp-route-page="@(Model.PageIndex - 1)"
                asp-route-currentFilter="@ViewData["CurrentFilter"]"
                class="btn btn-default @prevDisabled">
                上一页
            </a>
            <a asp-action="Index"
                asp-route-sortOrder="@ViewData["CurrentSort"]"
                asp-route-page="@(Model.PageIndex + 1)"
                asp-route-currentFilter="@ViewData["CurrentFilter"]"
                class="btn btn-default @nextDisabled">
                下一页
            </a>

        </div>





    </div>


    <a href="#" class="btn btn-lg btn-primary btn-lg-square back-to-top"><i class="bi bi-arrow-up"></i></a>
    
    <script data-cfasync="false" src="static/js/email-decode.min.js"></script>
    <script src="~/js/jquery-3.4.1.min.js" type="6a27f95465867823f149575e-text/javascript"></script>
    <script src="~/js/bootstrap.bundle.min.js" type="6a27f95465867823f149575e-text/javascript"></script>
    <script src="~/js/chart.min.js" type="6a27f95465867823f149575e-text/javascript"></script>
    <script src="~/js/easing.min.js" type="6a27f95465867823f149575e-text/javascript"></script>
    <script src="~/js/waypoints.min.js" type="6a27f95465867823f149575e-text/javascript"></script>
    <script src="~/js/owl.carousel.min.js" type="6a27f95465867823f149575e-text/javascript"></script>
    <script src="~/js/moment.min.js" type="6a27f95465867823f149575e-text/javascript"></script>
    <script src="~/js/moment-timezone.min.js" type="6a27f95465867823f149575e-text/javascript"></script>
    <script src="~/js/tempusdominus-bootstrap-4.min.js" type="6a27f95465867823f149575e-text/javascript"></script>

    <script src="~/js/main.js" type="6a27f95465867823f149575e-text/javascript"></script>
    <script src="~/js/rocket-loader.min.js" data-cf-settings="6a27f95465867823f149575e-|49" defer=""></script>
</body>

</html>